<%@page import="bean.MboardVO"%>
<%@page import="bean.MboardDTO"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>view</title>
<link rel="stylesheet" href="../css/mboardview.css">
<script src="../js/mboard.js"></script>
</head>
<body>
<jsp:useBean id="vo" class="bean.MboardVO" scope="page"></jsp:useBean>
<jsp:setProperty property="*" name="vo"/>
<%
 
MboardDTO dto = new MboardDTO();
dto.setVo(vo);
MboardVO v = dto.selectone();
if(session.getAttribute("sessionMid")!=null){
	if(session.getAttribute("sessionMid").equals(v.getMid())){
	}else{
	dto.viewcount(v.getVno());
	}
}else{
	dto.viewcount(v.getVno());
}

String [] t = v.getLev().split("-");

String f = "첨부없음";
if(v.getAttfile()!=null){
f = v.getAttfile();}
%>
<br><br>
작성자 : <%=v.getMid()%> <p/>
[ <%=v.getCategory() %> ] &nbsp;&nbsp;
제   목  : <%=v.getSubject()%> <br><br><br>
 ----내   용---- <div id ="vcon"><pre><%=v.getContent()%></pre></div><p/>
<% if(t.length==1){ %>
첨   부 : <%=f%> <p/>
<%} %>

<input type="button" id="btnlist" value="목록으로">
<%if(session.getAttribute("sessionMid")!=null){
if(session.getAttribute("sessionMid").equals(v.getMid())){ %>
<input type="button" id="btninput" value="새글쓰기">
<input type="button" id="btndel" value="삭제">
<input type="button" id="btnmodi" value="수정">
<%}else if(t.length<3){%>
	<input type="button" id="btninputre" value="답글쓰기">
	<%} 

}%>


<form name="viewfrm" method="post">
	<input type="hidden" name="rno" value="<%=vo.getRno()%>">
	<input type="hidden" name="lev" value="<%=v.getLev()%>">
	<input type="hidden" name="grp" value="<%=v.getGrp()%>">
	<input type="hidden" name="attfile" value="<%=v.getAttfile()%>">
	<input type="hidden" name="subject" value="<%=v.getSubject()%>">
	<input type="hidden" name="content" value="<%=v.getContent()%>">
	<input type="hidden" name="category" value="<%=v.getCategory()%>">
</form>
<form name="listfrm" method="post">
	<input type="hidden" name="nowpage" value="<%=vo.getNowpage()%>">
	<input type="hidden" name="find" value="<%=vo.getFind()%>">
	<input type="hidden" name="search" value="<%=vo.getSearch()%>">
	<input type="hidden" name="rno" value="<%=vo.getRno()%>">
</form>
<script>viewinit();</script>
</body>
</html>